/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.wpi.first.wpilibj.templates.subsystems;


import edu.wpi.first.wpilibj.RobotDrive;
import edu.wpi.first.wpilibj.command.Subsystem;
import edu.wpi.first.wpilibj.templates.RobotMap;
import edu.wpi.first.wpilibj.templates.OI;
import edu.wpi.first.wpilibj.templates.OI;
import edu.wpi.first.wpilibj.templates.RobotMap;
import edu.wpi.first.wpilibj.templates.commands.DriveWithJoystick;

/**
 *
 * @author Jared
 */
public class Chassis extends Subsystem {
    // Put methods for controlling this subsystem
    // here. Call these from Commands.
   private static Chassis instance = null;
   private RobotDrive drive;
   
   public static Chassis getInstance() {
       if(instance == null) {
           instance = new Chassis();
           instance.setDefaultCommand(new DriveWithJoystick());
       }
       return instance;
   }
   
   private Chassis() {
       drive = new RobotDrive(RobotMap.LEFT_MOTOR_PORT, RobotMap.RIGHT_MOTOR_PORT);
       drive.setSafetyEnabled(false);
   }
   
   public void straight() {
       drive.arcadeDrive(RobotMap.AUTO_FORWARD_SPEED, 0.0);
   }
   
   public void turnLeft() {
       drive.arcadeDrive(0.0, RobotMap.AUTO_TURN_AMOUNT);
   }
   
   public void driveWithJoystick(){
       drive.arcadeDrive(OI.getInstance().getDriveStick());
   }

    public void initDefaultCommand() {
        // Set the default command for a subsystem here.
        //setDefaultCommand(new MySpecialCommand());
    }
}
